#
# "@(#) $Id: LArtworkWindow.py,v 1.1.1.1 2006-07-27 03:16:08 gioshe Exp $"
#
# This work is released under the GNU GPL, version 2 or later.
#
from qt import *

_artWindows = []

class LArtworkWindow(QWidget):
	def __init__(self,pixmap,name):
		global _artWindows
		QWidget.__init__(self,None,"artworkwindow",Qt.WType_TopLevel)
		self.setCaption(name)
		self.label = QLabel("",self)
		self.label.setPixmap(pixmap)
		size = pixmap.size()
		self.label.setFixedSize(size)
		self.setFixedSize(size)
		self.show()
		_artWindows.append(self)

	def closeEvent(self,ev):
		global _artWindows
		_artWindows.remove(self)
		QWidget.closeEvent(self,ev)

	def static_closeAll():
		global _artWindows
		while len(_artWindows):
			_artWindows[0].close()
	closeAll = staticmethod(static_closeAll)
